﻿using System.Collections.ObjectModel;

namespace XamlingCore.Infrastructure.Extensions
{
    public static class AsObservable
    {
        public static ObservableCollection<T> AsObservableCollection<T>(this System.Collections.Generic.IEnumerable<T> col)
        {
            ObservableCollection<T> newcol = new ObservableCollection<T>();

            foreach (T item in col)
            {
                newcol.Add((T)item);
            }

            return newcol;
        }
    }
}
